﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Themes/Main.master" AutoEventWireup="true"
    CodeBehind="UserList.aspx.cs" Inherits="TrainingsApp.IPADApp.Permission.UserList" %>

<%@ Register Assembly="TrainingsApp.Controls" Namespace="TrainingsApp.Controls.GridViewExt"
    TagPrefix="GridViewExt" %>
<%@ Register Assembly="TrainingsApp.Controls" Namespace="TrainingsApp.Controls.TextControlExt"
    TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="../Scripts/Dialog.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        function edit(title, action, id) {
            return openChildDialog(title, 'UserEdit.aspx?ActionCode=' + action + '&BizCode=' + id, 600, 300);
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table width="100%" cellpadding="0" cellspacing="1" class="tablist2">
        <tr>
            <td class="td1">
                用户名
            </td>
            <td class="td2">
                <cc1:TextControlExt ID="UserName" runat="server"></cc1:TextControlExt>
            </td>
            <td class="td1">
                姓名
            </td>
            <td class="td2">
                <cc1:TextControlExt ID="Name" runat="server"></cc1:TextControlExt>
            </td>
        </tr>
        <tr>
            <td colspan="4" class="td3">
                <asp:Button ID="btnSelect" runat="server" Text="查询" class="search" onmouseout="this.className='search'"
                    onmouseover="this.className='search_hover'" OnClick="btnSelect_Click" ClientIDMode="Static" />
                <asp:Button ID="btnAdd" runat="server" Text="添加" class="add" onmouseout="this.className='add'"
                    onmouseover="this.className='add_hover'" />
            </td>
        </tr>
    </table>
    <GridViewExt:GridViewExt ID="GridView" runat="server" Width="100%" AutoGenerateColumns="False"
        CssClass="table" OnRowCommand="GridView_RowCommand" ShowHeaderWhenEmpty="true"
        AllowPaging="true" OnBindData="GridView_BindData">
        <Columns>
            <asp:TemplateField HeaderText="序号">
                <ItemTemplate>
                    <%# Container.DataItemIndex + 1 + this.GridView.PageSize*(this.GridView.PageIndex-1) %>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField HeaderText="用户名" DataField="UserName" />
            <asp:BoundField HeaderText="姓  名" DataField="Name" />
            <asp:BoundField HeaderText="身份证" DataField="IdentityCard" />
            <asp:TemplateField HeaderText="操作">
                <ItemTemplate>
                    <asp:LinkButton ID="lbtView" runat="server" CommandName="vi" Text="查看" OnClientClick=<%# String.Format("return edit('用户查看','{0}','{1}')", ClientConstSet.Select,Eval("Idx")) %>></asp:LinkButton>
                    <asp:LinkButton ID="lbtEdit" runat="server" CommandName="ed" Text="编辑" OnClientClick=<%# String.Format("return edit('用户编辑','{0}','{1}')", ClientConstSet.Update,Eval("Idx")) %>></asp:LinkButton>
                    <asp:LinkButton ID="lbtDelete" runat="server" OnClientClick="return confirm('您确认要删除吗?');"
                        CommandName="del" Text="删除" CommandArgument='<%# Eval("Idx") %>'></asp:LinkButton>
                    <asp:LinkButton ID="lbtRole" runat="server" CommandName="ed" Text="分配角色" PostBackUrl='<%# "~/Permission/UserRole.aspx?BizCode=" + Eval("Idx") + "&name=" + Server.UrlEncode(Eval("Name").ToString()) %>'></asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </GridViewExt:GridViewExt>
</asp:Content>
